# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=pavucontrol-qt
pkgver=1.4.0
pkgrel=0
pkgdesc="Pulseaudio mixer in Qt (port of pavucontrol)"
url="https://github.com/lxqt/pavucontrol-qt"
arch="all !armhf" # blocked by liblxqt-dev
license="LGPL-2.0-or-later"
makedepends="
	cmake samurai lxqt-build-tools liblxqt-dev
	qt5-qttools-dev pulseaudio-dev
	"
options="!check" # No testsuite
subpackages="$pkgname-lang"
source="https://github.com/lxqt/pavucontrol-qt/releases/download/$pkgver/pavucontrol-qt-$pkgver.tar.xz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

lang() {
	install_if="lang $pkgname=$pkgver-r$pkgrel"
	amove usr/share/$pkgname/translations
}

sha512sums="
cfa878bddd0b0299319c31a4e97aa8b6dc799f040fedf5ca0210d8eeb526f59258aab57ae050987633826c7a94fbbd0e1a1b1fc184fc8693541c799b6118a157  pavucontrol-qt-1.4.0.tar.xz
"
